/*
 * main.c
 *
 *  Created on: Jun 28, 2013
 *      Author: cbach
 */


#include <stdio.h>
#include <string.h>
#include "slipmodel.h"
#include "catalog.h"


int main() {

//    struct slipmodel model1, model2;
//    int idum;
//
//    strcpy(model1.filename, "Input/pscmp_landers_wald.inp");
//    idum = slipmodelRead(&model1);
//    if (idum != 0) {
//        fprintf(stderr, "\n\nError reading slipmodel!\n\n\n");
//        return(-1);
//    }
//
//    slipmodelCopy(model1, &model2);
//    strcpy(model2.filename, "Input/pscmp_landers_wald_random.inp");
//
//    slipmodelRandomslip(&model2, -2, 7.3, 2, 1);
//
//    idum = slipmodelWrite(model2);


    double **catalog;
    int i, numberLines;


    numberLines = catalogRead("/mnt/home/bach/Work/csep-project/Input/catalog.dat", &catalog);

    printf("Catalog number of lines: %d\n", numberLines);

    catalogFree(&catalog, numberLines);

    for (i=1; i<= numberLines; i++)
        printf("%lf %lf %lf %lf %lf\n", catalog[i][1], catalog[i][2], catalog[i][3], catalog[i][4], catalog[i][5]);

    return(0);

}
